<?php
/**
 * Form_File
 *
 * класс Form_File позволяет работать с <input type="file"
 * @author Дмитрий Кузьма <kouzma.d@gmail.com>
 * @version 2.1
 */
class Form_File extends Form_Element
{

  function __construct(array $arrSettings = array(), $fieldName = null, $showInConstruct = false) {
  	parent::__construct($arrSettings, $fieldName);
    if ($showInConstruct)
      $this->show();
  }
  /**
   * Выводит элемент
   *
   */
  public function show() {
  	$this->checkForErrors();
  	echo '<input type="file"';
  	$this->showElementAttributes();

  	echo ' />';
  	$this->showAfterElementMessage();
  }
  /**
   * Получает атрибут name
   *
   * @return string
   */
  public function getName() {
  	return $this->_name;
  }

	public function checkForErrors() {
		$errText = Exception_ActiveRecord::getExceptionOfField($this->_name);
		if ($errText) {
			$this->_isError = true;
			$this->_errorText = $errText;
		}
	}


}
?>